﻿using System.Configuration;
using System.Data;
using System.Windows;

namespace DebugUi
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        protected override void OnStartup(StartupEventArgs e)
        {
            //全局监听异常
            base.OnStartup(e);
            this.DispatcherUnhandledException += new System.Windows.Threading.DispatcherUnhandledExceptionEventHandler(App_DispatcherUnhandledException);
        }

        void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
        {
            HandyControl.Tools.ConfigHelper.Instance.SetLang("zh-CN");
            //提示
            HandyControl.Controls.MessageBox.Error(e.ToString());
            //已处理
            e.Handled = true;
        }
    }

}
